<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Edition de l'equipe ${team.name}</title>
</head>
<body>
<div>
	<div class="oneLine">
		<form action="/shoot/edit?id=${team.shootDay.id}"  method="post">
			<input type="submit" class="undo" value=""/>
		</form>
	</div>
	<div class="oneLine">
		<fmt:formatNumber var="avg" type="number"  maxFractionDigits="2" minFractionDigits="2" value="${team.getAverageHandicap()}" />
		<h1>${team.name} - ${avg}%</h1>
	</div>
</div>
<c:forEach items="${team.getListPerson()}" var="person">
<div>
	<div class="oneLine">
		<form action="/team/deleteshooter"  method="post">
			<input type="hidden" name="idShooter" value="${person.id}"/>
			<input type="hidden" name="idTeam" value="${team.id}"/>
			<input type="submit" class="delete" value=""/>
		</form>
	</div>
	<div class="oneLine">
			<fmt:formatNumber var="handicap" type="number"  maxFractionDigits="2" minFractionDigits="2" value="${person.getLastHandicap().currentHandicap}" />
		${person.name} ${person.forName} - ${handicap}% - ${person.getLastHandicap().categorie}
		
	</div>
</div>
</c:forEach>

	<form action="/team/addshooter"  method="post">
		<select name="idShooter">
		    <c:forEach items="${listPerson}" var="pers">
		        <option value="${pers.id}">${pers.name} ${pers.forName}</option>
		    </c:forEach>
		</select>
		<input type="hidden" name="idTeam" value="${team.id}"/>
		<input type="submit" class="add" value=""/>
	</form>
</body>
</html>